package com.lyn.pluginhost.viewModel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.lyn.pluginapi.entity.PluginInfo
import com.lyn.pluginhost.plugin.PluginManager

/**
 *
 * @author longyn 2025/07/07
 * @version 1.0.0
 */
class PluginViewModel : ViewModel() {

    val pluginInfoLiveData: MutableLiveData<MutableList<PluginInfo>> = MutableLiveData()

    suspend fun loadAllPlugin() {
        val pluginInfos = PluginManager.instance.loadAllPlugin()
        pluginInfoLiveData.postValue(pluginInfos)
    }
}